package com.yulebaby.callsenter.database;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.yulebaby.callsenter.bean.CallLogBean;
import com.yulebaby.callsenter.bean.CustomerBean;

import com.yulebaby.callsenter.database.CallLogBeanDao;
import com.yulebaby.callsenter.database.CustomerBeanDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig callLogBeanDaoConfig;
    private final DaoConfig customerBeanDaoConfig;

    private final CallLogBeanDao callLogBeanDao;
    private final CustomerBeanDao customerBeanDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        callLogBeanDaoConfig = daoConfigMap.get(CallLogBeanDao.class).clone();
        callLogBeanDaoConfig.initIdentityScope(type);

        customerBeanDaoConfig = daoConfigMap.get(CustomerBeanDao.class).clone();
        customerBeanDaoConfig.initIdentityScope(type);

        callLogBeanDao = new CallLogBeanDao(callLogBeanDaoConfig, this);
        customerBeanDao = new CustomerBeanDao(customerBeanDaoConfig, this);

        registerDao(CallLogBean.class, callLogBeanDao);
        registerDao(CustomerBean.class, customerBeanDao);
    }
    
    public void clear() {
        callLogBeanDaoConfig.getIdentityScope().clear();
        customerBeanDaoConfig.getIdentityScope().clear();
    }

    public CallLogBeanDao getCallLogBeanDao() {
        return callLogBeanDao;
    }

    public CustomerBeanDao getCustomerBeanDao() {
        return customerBeanDao;
    }

}
